package com.soxing.braindata.common.config;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.model.Info;
import com.github.dockerjava.core.DockerClientBuilder;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class DockerConfig {



    @Value("${docker.ip}")
    String ip;

    @Bean
    public DockerClient connectDocker(){
        //DockerClient dockerClient = DockerClientBuilder.getInstance("tcp://192.168.1.41:2375").build();
        DockerClient dockerClient = DockerClientBuilder.getInstance("tcp://"+ip+":2375").build();
        return dockerClient;
    }
}
